#ifndef __UTILS_H__
#define __UTILS_H__
/*============================================================================*/
/* Reading/saving the list of corners from/on a file. In case of success,     */
/* the functions return the number of corners that were read/saved. Both      */
/* functions return -1 in case of any problems with the files; readCornerList */
/* returns -2 if the array for corners is not big enough.                     */

int loadCornerList(char *fileName, int *corners, int arraySize);
int saveCornerList(char *fileName, int *corners, int numCorners);

/*============================================================================*/
/* Evaluates the result of the detection; actSol contains the solution to be  */
/* evaluated (x,y coordinates of corners), refSol contains a reference        */
/* solution. The parameters actSolLen, refSolLen contain the number of corners*/
/* in the evaluated and reference solutions, respectively.                    */

int evaluateDetection( int *actSol, int actSolLen, int *refSol, int refSolLen,
                       int *numFound, int *numMissed, int *numFalse,
                       int *numMmultiple, int *totErr,  float *locErr);

/*============================================================================*/
/* Reads the grey-scale image whose name is in fileName and loads it into the */
/* memory. Returns the pointer to the image as a function value, and the sizes*/
/* of the image in xSize, ySize. In case of any failure, NULL is returned.    */

unsigned char *loadImageFromTGA(char *fileName, int *xSize, int *ySize );

/*============================================================================*/
/* Reads next line from inpFile and returns the first atom on this line.      */

int readAtom(FILE *inpFile, char *atom);

/*============================================================================*/
#endif

